package com.gitee.wsl.common.ui.symbol

import androidx.compose.ui.graphics.Path
import com.gitee.wsl.common.ui.base.Point
import com.gitee.wsl.mathematics.geometry.shape.Cross

fun Symbol.Companion.cross(position: Point, radius: Float = 1.0f) = Cross(position, radius)


fun Path.cross(cross: Cross){
    val r3 = 3 * cross.radius
    with(cross) {
        moveTo(position.x - r3, position.y - radius )
        lineTo(position.x - radius , position.y - radius )
        lineTo(position.x - radius , position.y - r3)
        lineTo(position.x + radius , position.y - r3)
        lineTo(position.x + radius , position.y - radius )
        lineTo(position.x + r3, position.y - radius )
        lineTo(position.x + r3, position.y + radius )
        lineTo(position.x + radius , position.y + radius )
        lineTo(position.x + radius , position.y + r3)
        lineTo(position.x - radius , position.y + r3)
        lineTo(position.x - radius , position.y + radius )
        lineTo(position.x - r3, position.y + radius )
        close()
    }
}